package server.business.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @date 2022/07/30
 */
@Accessors(chain = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult extends Result implements Serializable {
    private Integer current;    //当前页
    private Integer pageSize;      //每页数量
    private long total;     //总数据数
    private Long pages;     //页面数

    public PageResult(String code, String msg, Object data, Integer current, Integer pageSize, long total, Long pages) {
        super(code, msg, data);
        this.current = current;
        this.pageSize = pageSize;
        this.total = total;
        this.pages = pages;
    }

    @Override
    public String toString() {
        return "SampleDataVo{" +
                "current=" + current +
                ", limit=" + pageSize +
                ", total=" + total +
                ", pages=" + pages +
                "} " + super.toString();
    }
}
